package cn.wizzer.app.user.modules.models;

import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

/**
 * 聊天室举报
 */
@Data
@Table("user_chat_report")
@TableIndexes({@Index(name = "INDEX_CT_AT", fields = {"ctAt"}, unique = false)})
public class ChatReport extends BaseModel {

    @Column
    @Name
    @Comment("ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(els = {@EL("uuid()")})
    private String id;

    @Column
    @Comment("状态 0待处理 1已处理 2无效")
    @Default("0")
    @ColDefine(type = ColType.INT)
    private int state;

    @Column("content")
    @Comment("举报内容（简述")
    @ColDefine(type = ColType.VARCHAR, width = 256)
    private String content;

    @Column("img_uris")
    @Comment("附带图片")
    @ColDefine(type = ColType.VARCHAR, width = 256)
    private String imgUris;

    @Column("creator")
    @Comment("举报人")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String creator;

    @Column("to_user")
    @Comment("被举报人")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String toUser;

    @Column
    @Comment("创建时间")
    @PrevInsert(els = @EL("$me.now()"))
    //Long不要用ColDefine定义,兼容oracle/mysql,支持2038年以后的时间戳
    private Long ctAt;

}
